Skip to content

Conversation

@harm-less
Copy link

@harm-less harm-less commented Apr 28, 2016

On several places semicolons have been added because it caused errors
due to certain minifying actions if they weren't there.

Clarification:

Minified with fix (but kept the structure):

function(a) {
    "use strict";
    function b(a) {
        a.parent instanceof Function && (b.apply(this, [ a.parent ]), this["super"] = c(this, d(this, this.constructor))), 
        a.apply(this, arguments);
    }
    function c(a, b) {
        for (var c in a) "super" !== c && a[c] instanceof Function && (b[c] = a[c]["super"] || d(a, a[c]));
        return b;
    }
    function d(a, b) {
        var c = a["super"];
        return b["super"] = function() {
            return a["super"] = c, b.apply(a, arguments);
        };
    }
    a.Class = function() {}, a.Class.extend = function e(a) {
        function d() {
            b !== arguments[0] && (b.apply(this, [ a ]), c(this, this), this.initializer instanceof Function && this.initializer.apply(this), 
            this.constructor.apply(this, arguments));
        }
        return d.prototype = new this(b), d.prototype.constructor = d, d.toString = function() {
            return a.toString();
        }, d.extend = function(b) {
            return b.parent = a, e.apply(d, arguments);
        }, d;
    }, a.Class = a.Class.extend(function() {
        this.constructor = function() {};
    });
}(this), function(a, b) {
... other libraries

The second line from the bottom is important (}(this), function(a, b) {). Without the fix it looks like this when minified:

function(a) {
...extend code
}(this)(function(a, b)) {
... other libraries

This doesn't play nice at all with the other libraries because it causes an error.

Actually only the last semicolon is important from this pull request, but I thought I'd add them to several other methods as well.

On several places semicolons have been added because it caused errors
due to certain minifying actions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant